/*
 * Copyright (c) 2015, Devan Lai
 *
 * Permission to use, copy, modify, and/or distribute this software
 * for any purpose with or without fee is hereby granted, provided
 * that the above copyright notice and this permission notice
 * appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef RETARGET_H_INCLUDED
#define RETARGET_H_INCLUDED

#include <unistd.h>

#define NO_USART 0xFFFFFFFFU
#define VIRTUAL_USART 0xFFFFFFFEU

extern void retarget(int file, uint32_t usart);
extern int _write(int file, char *ptr, int len);

extern void print_hex(uint32_t x);
extern void print_hex_nibble(uint8_t x);
extern void print_hex_byte(uint8_t x);
extern void print(const char* s);
extern void println(const char* s);

#endif
